thermostat6 2.2.1
Loading...
Searching...
No Matches
Thermostat 6 Click Driver

API for configuring and manipulating Thermostat 6 Click driver. More...

Topics

 Thermostat 6 Registers Settings
 Settings for registers of Thermostat 6 Click driver.
 Thermostat 6 MikroBUS Map
 MikroBUS pin mapping of Thermostat 6 Click driver.

Functions

void thermostat6_cfg_setup (thermostat6_cfg_t *cfg)
 Thermostat 6 configuration object setup function.
err_t thermostat6_init (thermostat6_t *ctx, thermostat6_cfg_t *cfg)
 Thermostat 6 initialization function.
err_t thermostat6_get_adc_v (thermostat6_t *ctx, float *voltage)
 Thermostat 6 get adc voltage function.
err_t thermostat6_get_adc_v_avg (thermostat6_t *ctx, float *voltage, uint16_t num_samples)
 Thermostat 6 get adc voltage average function.
err_t thermostat6_get_an_pin_v (thermostat6_t *ctx, float *voltage)
 Thermostat 6 get AN pin voltage function.
err_t thermostat6_get_an_pin_v_avg (thermostat6_t *ctx, float *voltage, uint16_t num_samples)
 Thermostat 6 get AN pin voltage function.
err_t thermostat6_set_vref (thermostat6_t *ctx, float vref)
 Thermostat 6 set vref function.
uint8_t thermostat6_get_relay_pin (thermostat6_t *ctx)
 Thermostat 6 get relay pin function.
float thermostat6_get_temperature (float voltage)
 Thermostat 6 get temperature function.

Detailed Description

API for configuring and manipulating Thermostat 6 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ thermostat6_cfg_setup()

void thermostat6_cfg_setup ( thermostat6_cfg_t * cfg)

Thermostat 6 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See thermostat6_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ thermostat6_get_adc_v()

err_t thermostat6_get_adc_v ( thermostat6_t * ctx,
float * voltage )

Thermostat 6 get adc voltage function.

This function reads raw ADC value and converts it to proportional voltage level.

Parameters
[in]ctx: Click context object. See thermostat6_t object definition for detailed explanation.
[out]voltage: Output voltage level [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered reference voltage.

◆ thermostat6_get_adc_v_avg()

err_t thermostat6_get_adc_v_avg ( thermostat6_t * ctx,
float * voltage,
uint16_t num_samples )

Thermostat 6 get adc voltage average function.

This function reads and averages the ADC voltage for a desired number of samples.

Parameters
[in]ctx: Click context object. See thermostat6_t object definition for detailed explanation.
[out]voltage: Output voltage level [V].
[in]num_samples: Number of ADC samples.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered reference voltage.

◆ thermostat6_get_an_pin_v()

err_t thermostat6_get_an_pin_v ( thermostat6_t * ctx,
float * voltage )

Thermostat 6 get AN pin voltage function.

This function reads the voltage from AN pin.

Parameters
[in]ctx: Click context object. See thermostat6_t object definition for detailed explanation.
[out]voltage: Output voltage level [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered reference voltage.

◆ thermostat6_get_an_pin_v_avg()

err_t thermostat6_get_an_pin_v_avg ( thermostat6_t * ctx,
float * voltage,
uint16_t num_samples )

Thermostat 6 get AN pin voltage function.

This function reads and averages the AN pin voltage for a desired number of samples.

Parameters
[in]ctx: Click context object. See thermostat6_t object definition for detailed explanation.
[out]voltage: Output voltage level [V].
[in]num_samples: Number of ADC samples.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered reference voltage.

◆ thermostat6_get_relay_pin()

uint8_t thermostat6_get_relay_pin ( thermostat6_t * ctx)

Thermostat 6 get relay pin function.

This function returns the relay pin logic state.

Parameters
[in]ctx: Click context object. See thermostat6_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ thermostat6_get_temperature()

float thermostat6_get_temperature ( float voltage)

Thermostat 6 get temperature function.

This function calculates temperature in degrees Celsius based on a voltage input using the NTC Thermistor 10k Cylindrical Probe (B57500M0103A005) R/T characteristics map.

Parameters
[in]voltage: Voltage input for temperature calculation.
Returns
Temperature in degrees Celsius.
Note
None.

◆ thermostat6_init()

err_t thermostat6_init ( thermostat6_t * ctx,
thermostat6_cfg_t * cfg )

Thermostat 6 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See thermostat6_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See thermostat6_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermostat6_set_vref()

err_t thermostat6_set_vref ( thermostat6_t * ctx,
float vref )

Thermostat 6 set vref function.

This function sets the voltage reference for Thermostat 6 Click driver.

Parameters
[in]ctx: Click context object. See thermostat6_t object definition for detailed explanation.
[in]vref: Reference voltage (volts).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The default voltage reference set with thermostat6_init is 3.3V. The THERMOSTAT6_VREF_3V3 macro is used as AN pin reference.